package com.blog.wu.myblog.restful;

import java.io.Serializable;

/**
 * @Author wuyanshen
 * @Date 2018-12-04 3:46 PM
 * @Discription 请求结果对象
 */
public class Result implements Serializable {

    private String code;//请求状态

    private Object obj;//请求结果

    private String message;//请求信息

    public Result() {
    }

    public static Result Success(Object obj, String message){
        return new Result("1", message, obj);
    }

    public static Result Error(Object obj, String message){
        return new Result("-1",message, obj);
    }

    public Result(String code,String message, Object obj) {
        this.code = code;
        this.obj = obj;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
